package com.jeff.tianti.cms.service;

import com.jeff.tianti.cms.dto.QuestionsAnswersQueryDTO;
import com.jeff.tianti.cms.dto.font.AnswersTo;
import com.jeff.tianti.cms.entity.Answers;
import com.jeff.tianti.cms.dao.AnswersDao;
import com.jeff.tianti.cms.dto.AnswersQueryDTO;
import com.jeff.tianti.common.service.CommonService;
import com.jeff.tianti.common.entity.PageModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * @author xujianfang
 * @desc AnswersService类 
 * @date 2019-07-19
 */
@Service
public class AnswersService extends CommonService< Answers,String >  {

    @Autowired
    private AnswersDao answersDao;

    @Autowired
    public void setAnswersDao(AnswersDao answersDao){
      super.setCommonDao(answersDao);
    }

    public PageModel<Answers> queryAnswersPage(AnswersQueryDTO answersQueryDTO){
           return this.answersDao.queryAnswersPage(answersQueryDTO);
    }

    public List<Answers> queryAnswersList(AnswersQueryDTO answersQueryDTO){
           return this.answersDao.queryAnswersList(answersQueryDTO);
    }


    public PageModel<Answers> queryAnswersPages(QuestionsAnswersQueryDTO questionsAnswersQueryDTO) {
        return this.answersDao.queryAnswersPages(questionsAnswersQueryDTO);
    }

    public List<Answers> findAllByQuestionsAnswersId(String id) {
        return this.answersDao.findAllByQuestionsAnswersId(id);
    }

    public PageModel<Answers> findPageByAnswersTo(AnswersTo answersTo) {
        return answersDao.findPageByAnswersTo(answersTo);
    }

    public Page<Answers> findPageByqueUid(String uid, Pageable pageable) {
        return answersDao.findPageByqueUid(uid,pageable);
    }

    public Page findPageByUid(String uid, Pageable pageable) {
        return answersDao.findPageByUid(uid,pageable);
    }
}